<%-- 
    Document   : detallespedido
    Created on : 26-ene-2012, 12:23:49
    Author     : Fran & Cris
--%>

<%@page import="com.ipartek.formacion.gestformwww.modelo.beans.Material"%>
<%@page import="java.sql.Timestamp"%>
<%@page import="java.util.Date"%>
<%@page import="com.ipartek.formacion.gestformwww.modelo.beans.Contacto"%>
<%@page import="java.util.ResourceBundle"%>
<%@page import="com.ipartek.formacion.gestformwww.modelo.beans.Cliente"%>
<%@page import="com.ipartek.formacion.gestformwww.modelo.beans.TipoCurso"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.ipartek.formacion.gestformwww.controlador.Verificador"%>
<%@page import="com.ipartek.formacion.gestformwww.modelo.beans.Curso"%>

<%@include file="validarusuario.jsp"%>

<%Material material = (Material) request.getAttribute("materialMostrar");%>

<form action="visualizar-candidato-accion.do" name="volver" method="POST">
    <input type="hidden" name="idCurso" value="<%=request.getAttribute("idCurso")%>" />
    <%--<input type="hidden" name="cambios" value="" />--%>
</form>



<form action="realizar-pedido-accion.do" method="POST" name="formPedido" >

    <input type="hidden" name="aleatorioPedidoMaterial" value="<%=Math.random()%>" />
    <div class="contenido">

        <h2 align="center">Detallar pedido</h2>
        <jsp:include page="menudetallespedido.jsp"  flush="true" />
        <br>
        <jsp:include page="mensajes.jsp" flush="true" />
        <jsp:include page="errores.jsp" flush="true" />
        <jsp:include page="excepciones.jsp" flush="true" />

        <div>
            <h4>
                <input type="hidden"  name="idCurso" value="<%= request.getParameter("idCurso")%>">
                <input type="hidden"  name="materialId" value="<%= material.getLibId()%>">

                <table class="tableFormulario" width="100%">
                    <tr>
                        <td colspan="2">Material&nbsp;seleccionado:</td>
                        <td colspan="2" ><input id="sololectura" type="text" size="50" name="libTitulo" maxlength="50"  value="<%=material.getLibTitulo()%>" readonly> </td>

                    </tr>

                    <tr>
                        <td colspan="2"><label id="labelStock">Cantidad&nbsp;necesitada</label></td>
                        <td colspan="1"><input type="text" size="10" name="cantNecesaria" maxlength="5" value="" onKeyUp="if (!validarNumero(this.value, false, true)) this.value=''" /></td>
                    </tr>
                    <tr>
                        <td colspan="2"><input class="nobordefondoazul" type="checkbox" name="gestionStock" value="false"
                           onclick="javascript:if(this.checked==1){noGestionaMaterial(document.formPedido)}
                               else{gestionaMaterial(document.formPedido)}"> No gestionar stock/pedido </td>
                    </tr>
                
                    <tr>
                        <td colspan="2"><label id="labelPedir">Usar&nbsp;del&nbsp;stock:</label></td>
                        <td colspan="1">
                            <input type="hidden"  name="cantStock" value="">
                            <select style="width: 22%;"name="stockDisponible" onChange="calculaMaterialPedir(document.formPedido)">
                                <%for (int i = 0; i < material.getLibCantidadAlu() + 1; i++) {%>
                                <option><%=i%></option>
                                <%}%>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">A&nbsp;pedir:</td>
                        <td colspan="1"><input type="text" size="10" name="cantPedir" maxlength="5" value="" onKeyUp="if (!validarNumero(this.value, false, true)) this.value=''"></td>
                    </tr>
                </table>
            </h4>
        </div>
    </div>
</form>
